package com.gong.DesignPattern.CompositePattern;

/**
 * @author GongChang
 * @version 1.0
 * @date 2021/6/17 0017 9:29
 */
//组合模式
public class Test {

    public static void main(String[] args) {
        Emplore emplore = new Emplore("jack","ceo",80000);
        Emplore emplore1 = new Emplore("abc","销售主管",50000);
        Emplore emplore2 = new Emplore("abc1","sales",3000);
        Emplore emplore3 = new Emplore("abc2","sales",3000);

        emplore.list.add(emplore1);
        emplore1.list.add(emplore2);
        emplore1.list.add(emplore3);

        for (Emplore emplore4 : emplore.list) {
            System.out.println(emplore4);
            for (Emplore emplore5 : emplore4.list) {
                System.out.println(emplore5);
            }
        }
    }
}
